package edu.ubb.scrumster.model.model;

import java.sql.Date;

public class Comment implements AbstractModel {
	int id;
	User user;
	Date date;
	String text;

	public Comment(User user, Date date, String text) {
		super();
		this.user = user;
		this.date = date;
		this.text = text;
	}

	public Comment(int id, User user, Date date, String text) {
		super();
		this.id = id;
		this.user = user;
		this.date = date;
		this.text = text;
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	public Date getDate() {
		return date;
	}

	public void setDate(Date date) {
		this.date = date;
	}

	public String getText() {
		return text;
	}

	public void setText(String text) {
		this.text = text;
	}
	
	public void validate() throws ModelException{
		if (this.text.equals("") || this.text.isEmpty()){
			throw new ModelException("Comment is empty.");
		}
	}

}
